package com.sanqi.work.service.impl;

import java.util.List;
import com.sanqi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sanqi.work.mapper.WorkTeamMapper;
import com.sanqi.work.domain.WorkTeam;
import com.sanqi.work.service.IWorkTeamService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 班组Service业务层处理
 * 
 * @author duany
 * @date 2025-09-24
 */
@Service
public class WorkTeamServiceImpl extends ServiceImpl<WorkTeamMapper, WorkTeam> implements IWorkTeamService 
{
    @Autowired
    private WorkTeamMapper workTeamMapper;

    /**
     * 查询班组
     * 
     * @param id 班组主键
     * @return 班组
     */
    @Override
    public WorkTeam selectWorkTeamById(String id)
    {
        return workTeamMapper.selectWorkTeamById(id);
    }

    /**
     * 查询班组列表
     * 
     * @param workTeam 班组
     * @return 班组
     */
    @Override
    public List<WorkTeam> selectWorkTeamList(WorkTeam workTeam)
    {
        return workTeamMapper.selectWorkTeamList(workTeam);
    }

    /**
     * 新增班组
     * 
     * @param workTeam 班组
     * @return 结果
     */
    @Override
    public int insertWorkTeam(WorkTeam workTeam)
    {
        workTeam.setCreateTime(DateUtils.getNowDate());
        return workTeamMapper.insertWorkTeam(workTeam);
    }

    /**
     * 修改班组
     * 
     * @param workTeam 班组
     * @return 结果
     */
    @Override
    public int updateWorkTeam(WorkTeam workTeam)
    {
        workTeam.setUpdateTime(DateUtils.getNowDate());
        return workTeamMapper.updateWorkTeam(workTeam);
    }

    /**
     * 批量删除班组
     * 
     * @param ids 需要删除的班组主键
     * @return 结果
     */
    @Override
    public int deleteWorkTeamByIds(String[] ids)
    {
        return workTeamMapper.deleteWorkTeamByIds(ids);
    }

    /**
     * 删除班组信息
     * 
     * @param id 班组主键
     * @return 结果
     */
    @Override
    public int deleteWorkTeamById(String id)
    {
        return workTeamMapper.deleteWorkTeamById(id);
    }
}
